package com.itheima;

import java.util.Random;

public class Java_10 {
    public static void main(String[] args) {
        //案例：抢红包
        int[] arr = new int[]{11,22,33,44};
        start(arr);
    }
    public static void start(int[] moneys){
        Random r = new Random();

        for (int i = 0; i < moneys.length; i++) {
            int index = r.nextInt(moneys.length);
            int temp = moneys[index];
            moneys[index] = moneys[i];
            moneys[i] = temp;
            System.out.println(moneys[i]);



        }
    }
}
